package com.team2.cyber_eye;

import java.util.Timer;
import java.util.TimerTask;
import android.os.Bundle;
import android.widget.TextView;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;

public class Splash extends CyberActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
	
		final Timer splashTimer = new Timer();
		final Activity parent = this;
		
		 Typeface font1 = Typeface.createFromAsset(getAssets(), "font1.ttf");
		 
		 TextView customText1 = (TextView)findViewById(R.id.splash_text_title);
		 
		 customText1.setTypeface(font1);
		
		splashTimer.schedule(new TimerTask() {
			boolean run = false;
			@Override
			public void run() {
				splashTimer.cancel();
				splashTimer.purge();
				
				parent.overridePendingTransition(0, R.animator.fade_out);
				
				if (!run)
				{
					Intent intent = new Intent(parent, Options.class);
					intent.putExtra("Init", true);
					startActivity(intent);
					parent.finish();
					run = true;
				}
			}
		}, 2000, 2000);
	}
}
